Page({
  onShow() {
    this.getRepairList()
  },
  data: {
    statusMsg: {
      0: '已取消',
      1: '受理中',
      2: '上门中',
      3: '已完成',
    },
    statusType: {
      0: 'cancel',
      1: 'info',
      2: 'success',
      3: 'complete',
    }
  },
  goDetail(e) {
    wx.navigateTo({
      url: '/repair_pkg/pages/detail/index?id=' + e.mark.id,
    })
  },
  addRepair() {
    wx.navigateTo({
      url: '/repair_pkg/pages/form/index',
    })
  },
  async getRepairList() {
    const { data: { rows } } = await wx.http.get('/repair', { current: 1, pageSize: 20 })
    this.setData({
      repairList: rows
    })
  }
})
